<?php
	function set_elements_pos($page, $act, $id, $who, $nr=1){
		global $treeclass, $smarty, $smarty_ext;
		$sortby = $smarty_ext->get_sortby(array('parent'=>$page));
		$smarty->assign("sortby", $sortby);
		$treeclass->treepos($act, $id);
		$temp = $treeclass->_get_page_elements_with_content($page);
		$dat = array();
		foreach($temp as $item)
		{
		if ($item["type"]==$who) $dat[] = $item;
		}
		$smarty->assign("elements_list", $dat);
		$page_data = $smarty_ext->paging(array('elements'=>$dat, 'items_per_page'=>50, 'page'=>$nr));
		$smarty->assign("page_data", $page_data);
		$smarty->assign("elements_page", $nr);
		$smarty->assign("element_type", $eltypemd5);
		if ($who == "news_catalog"){
			$str = $smarty->fetch('admin/body/elements/news.htm');
		} elseif ($who == "images01"){
			$str = $smarty->fetch('admin/body/elements/images_galery01.htm');
		} elseif ($who == "images_galery01"){
			$str = $smarty->fetch('admin/body/elements/images_galery01.htm');
		} else {
			$str = $smarty->fetch('admin/body/elements/catalog.htm');
		}
		
		$objResponse = new xajaxResponse();
		//$objResponse->addAlert($who);
		$objResponse->addAssign("elements_id", "innerHTML", $str);
		return $objResponse;
	}
?>